<!-- 设备管理-设备维修-故障字典 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="设备名称">
              <el-input v-model="listQuery.fcatno" placeholder="类型名称" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="设备类别">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <el-button type="primary" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <!-- <el-button type="success" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button> -->
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FCATNO" label="设备编号" ></el-table-column>
          <el-table-column prop="FCATNAME" label="设备名称"></el-table-column>
          <el-table-column prop="FCATTYPE" label="设备类型" ></el-table-column>
          <el-table-column prop="FBRAND" label="品牌"></el-table-column>
          <el-table-column prop="FSPEC" label="型号" ></el-table-column>
          <el-table-column fixed="left" label="操作" align="center" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,

        //所属校区选择数据
        options1: [{
          value: '10',
          label: '单插'
        }, {
          value: '20',
          label: '双开'
        }, {
          value: '21',
          label: '空调'
        }, {
          value: '22',
          label: '通风柜'
        }, {
          value: '23',
          label: '智能柜'
        },
      ],

        customlist:[
          {
            "FCATNO": "100001",
            "FCATNAME": "单插A19",
            "FCATTYPE": "单插",
            "FBRAND": "轶轮",
            "FSPEC": "220v",
            "FNOTE":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
          },
        ],
        list: [
            {
            "FCATNO": "100001",
            "FCATNAME": "单插A19",
            "FCATTYPE": "单插",
            "FBRAND": "轶轮",
            "FSPEC": "220v",
            "FNOTE":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "100002",
            "FCATNAME": "双开B19",
            "FCATTYPE": "双开",
            "FBRAND": "轶轮",
            "FSPEC": "220v",
            "FNOTE":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },
            ,{
            "FCATNO": "100003",
            "FCATNAME": "春兰空调",
            "FCATTYPE": "空调",
            "FBRAND": "春兰",
            "FSPEC": "2021-1-A",
            "FNOTE":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "100005",
            "FCATNAME": "锡京通风柜T-19",
            "FCATTYPE": "通风柜",
            "FBRAND": "锡京",
            "FSPEC": "2000-DT-90",
            "FNOTE":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>